module Fabriq
  module Skype
    class Message

      attr_accessor :config, :room, :body, :from_name

      def initialize(room, body, from_name = "")
        @room = room
        @body = body
        @from_name = from_name
      end

      def config
        @config || Fabriq::Config
      end

      def private_session?
        self.room.private_session?
      end

      def direct?
        (self.config.skype_name && self.body.downcase.include?("@#{self.config.skype_name.downcase}")) == true
      end

    end    
  end
end